#ifndef _TCP_CLIENT_H_
#define _TCP_CLIENT_H_

#include "../define/define.h"
#include "../util/log.h"
#include "../util/lock.h"

class tcp_client
{
public:
	
	tcp_client(uint32 ip,uint16 port);
	~tcp_client();

	int sendbuf(char* buf, uint32 buf_size);
	bool recvbuf(char* buf, uint32 buf_size);

	bool con();
	
	uint32 get_socket();
	void   setnonblocking(uint32 socket);

private:

	uint32        my_sock;
	sockaddr_in   m_sock_addr;

	uint32        m_ip;
	uint16        m_port;

	logfile*      m_log;
	lock          m_lock;

	bool          m_con;
	
};

#endif
